package modele;

import vue.TextureFactory;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;

public abstract class Tank extends GameElement {

	private Rectangle hitBox;
	public final static Vector2 VITESSE = new Vector2(1, 1);
	
	public Tank(Vector2 v, World w) {
		super(v, w);
		hitBox = new Rectangle(v.x, v.y, getWidth(), getHeight());
	}

	public Rectangle getHitBox() {
		return hitBox;
	}

	public void setHitBox(Rectangle hitBox) {
		this.hitBox = hitBox;
	}

	@Override
	public float getWidth() {
		// TODO Auto-generated method stub
		return getTexture().getWidth();
	}

	@Override
	public float getHeight() {
		// TODO Auto-generated method stub
		return getTexture().getHeight();
	}

	@Override
	public Texture getTexture() {
		// TODO Auto-generated method stub
		return TextureFactory.getInstance().getTexture(Tank.class);
	}
	
	public void update(float vitesseX, float vitesseY){
		super.update(vitesseX, vitesseY);
		hitBox.setPosition(getPosition().x, getPosition().y);
	}
	
}
